BBC2RPC Version 1.00 ------------------------ Paul Theobald (25/01/97) Introduction ------------ BBC2RPC is a file transfer utility to copy files between two Acorn computers over a serial link. The program was primarily written for copying files from the author's old BBC micro to a new generation RiscPC, hence its name, though as it's written entirely in BBC BASIC the software should work on virtually all Acorn machines supporting a serial interface. The program is deliberately designed to be small, simple and low on features. This is so that: - Exactly the same program can be run ay each end of the serial line. This makes maintenance and upgradability much easier. - The program is as fast and efficient as possible. - The program is small enough that it's viable to be typed in by hand. This is necessary to avoid the 'chicken and egg' situation -- it's likely there's no other way to get this program onto both machines, otherwise why would you be wanting to use it in the first place? Requirements ------------ The program is written to use BBC BASIC level II or above. If necessary it could be easily modified to work on level I. It requires an RS423/RS232 serial port accessible via *FX and OSBYTE calls. The serial port on the two machines must be connected by a suitable serial cable. Thses can be purchased from Acorn suppliers or alternatively nip down to your local electronics store and for a couple of quid you can make one up yourself (see the 'Wiring' section below for details). The program must be loadable on both machines. Depending on your hardware you may be able to do this simply by transfer via disks, or alternatively through judicious use of *FX and *SPOOL calls at the command line (though this seems fraught with difficulties particularly on the Risc PC). Alternatively it may be quicker to just type it in manually. All you need is enough of the program to provide a bootstrap mechanism for transferring the whole program later on. The program is stuctured in such a way that the pieces you don't need (ie the 'send' and 'write_' procedures) can be left out. Additionally, missing out REM statements reduces this further to just over 60 lines of code. To Use ------ Firstly, start the program on both machines. You will be prompted with the following line: (S)end, (R)eceive, (*) command, (Q)uit? Press one of the bracketed characters to do the corresponding operation. - Hit 'S' to send a file. It will then prompt for a file name. Note that this is limited to 7 characters, and directory separators are not allowed. You will need to make sure you're in the right directory before you can send it. (Use the * command option to do this). The other machine must be in 'receiving' mode before the send will start. - Hit 'R' to receive a file. It does not prompt for a file name, as the one from the sending end is used. It will be saved to the current directory, so again make sure you're in the right directory before you start. Note that only the file name, file size and the contents of the file itself are sent. File attributes such as load address or modification date are not transferred and will need to be set up by hand. - Hit '*' to issue an operating system command. In particular the following commands are useful: *CAT to list the files in the current directory *DIR to change the current directory. - Hit 'Q' to quit the program. Configuration ------------- Configuration of the serial line is minimised by using operating system defaults. The only configurable option is the baud rate. Alter the initialisation of the baud_rate% variable at line 300 for different line speeds. Of course, both ends of the connection must be configured to use the same baud rate. The variable takes a value from 1 to 8, with meaning: 1 - 75 baud 2 - 150 baud 3 - 300 baud 4 - 1200 baud 5 - 2400 baud 6 - 4800 baud 7 - 9600 baud 8 - 19200 baud This comes pre-configured at 9600 baud. In practise (at least on a BBC micro) the speed is limited by the BASIC interpreter rather than line speed. Wiring ------ Wiring between machines of the same type should be straightforward, and is often described in the User Manuals. However, between machines of the different architectures wiring gets more complicated. One thing to note is that the BBC micro uses the RS232 lines in a different way to the de-facto standard PC (and RiscPC), namely the BBC micro's use of the RTS/CTS lines more closely corresponds to the PCs DTR/DSR lines than the true RTS/CTS definitions (a good description can be found in "The New Advanced User Guide" by Dickens & Holmes). Not having access to other machines in the range, the only wiring details I give here are of the BBC micro and RiscPC. BBC 5-pin domino socket - view of socket from back of computer _____ / \ / 5o o4 \ | | ) 1o | | | \ 2o o3 / \ _____ / RiscPC 9-way D-type plug - view of plug from back of computer 1 2 3 4 5 _____________________ | o o o o o | \ o o o o / \_________________/ 6 7 8 9 The following shows the simplest wiring I've found to work reliably between a BBC and RiscPC. RiscPC BBC 1 DCD <---+ 2 RxD <---|------------> TD 3 3 TxD <---|------------> RD 2 4 DTR <---+------------> CTS 2 5 0V <---|------------> Gnd 1 6 DSR <---|------------> RTS 5 7 RTS | 8 CTS <---+ 9 RI Contacts -------- Please send me any comments, bug reports, new info or suggestions. I can be contacted at the following addresses: SMTP: pt@datcon.co.uk X.400: c=GB;a=TMAILUK;p=DCNET;s=Theobald Paul Theobald 29 Lavender Gardens Enfield Middx EN2 0TP UK Distribution ------------ This software is 'Public Domain'. Feel free to copy, modify or distribute it so long as it remains in the public domain. If you do make any useful modifications please let me know so I can incorporate them into future versions.